Skip to content

fix(lexers): preserve literal hashes in SSH config arguments - #1516

Merged
github-actions[bot] merged 1 commit into
alecthomas:masterfrom
yxshee:fix/ssh-argument-comments-nov19
Nov 19, 2026
Merged

github-actions[bot] merged 1 commit into
alecthomas:masterfrom
yxshee:fix/ssh-argument-comments-nov19

Conversation

@yxshee

@yxshee yxshee commented Nov 19, 2026

Copy link
Copy Markdown
Contributor
Host *#prod # fleet
    IdentityFile /keys/user#prod # primary

OpenSSH reads the identity file above as /keys/user#prod. Chroma treats everything from the first # in the path onwards as a comment.

For all simple options as well as Host and Match arguments, any quoted strings will be highlighted accordingly, and an escaped space will be part of the current argument. Comments are only detected at the start of an argument. An unclosed quote also leaves the next line’s directive visible.

As can be seen from the fixture, the old behaviour was to highlight #prod # fleet as one CommentSingle token on master. For all 240 configurations, the comment boundaries matched the argument values reported by ssh -G. The full Go suite, lint and generated-file checks pass.

@github-actions
github-actions Bot enabled auto-merge (squash) November 19, 2026 12:01
@github-actions
github-actions Bot merged commit 407cfc0 into alecthomas:master Nov 19, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant